package com.own.business.wallet.entity.map;

import com.own.business.wallet.entity.po.Wallet;
import com.own.component.common.base.entity.BaseMap;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * WalletMapVo
 *
 * @author chenxueli
 * @date 2023-07-13 16:07:39
 */
@Schema(title = "钱包" + ConstantBeanSuffix.MAP_VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class WalletMapVo extends BaseMap<Wallet> implements Serializable {

    @Schema(title = "用户id")
    private Long userId;

    @Schema(title = "余额（分）")
    private Integer balance;

    @Schema(title = "冻结金额（分）")
    private Integer freezeAmount;

    @Schema(title = "是否设置免密支付（0=未设置 1=已设置）")
    private Integer isWithoutPassword;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public WalletMapVo(@NonNull Wallet entity) {
        super(entity);
        this.userId = entity.getFkUserId();
        this.balance = entity.getBalance();
        this.freezeAmount = entity.getFreezeAmount();
        this.isWithoutPassword = entity.getIsWithoutPassword();
    }

}
